/*
 * Copyright (c) 2015 www.smarthome.com All rights reserved.
 * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
 */
package com.smarthome.base.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.smarthome.base.dao.ShEquipmentUserDao;
import com.smarthome.base.dao.base.BaseDaoImpl;
import com.smarthome.domain.bean.ShEquipmentUser;
import com.smarthome.domain.vo.api.UserDeviceBean;

/**
 * ShEquipmentUserDaoImpl 实现类 设备与用户对应关系
 * @author szc
 * @since 2015-09-17
 */
@Repository("shEquipmentUserDao")
public class ShEquipmentUserDaoImpl extends BaseDaoImpl<ShEquipmentUser,Long> implements ShEquipmentUserDao {
	private final static String NAMESPACE = "com.smarthome.base.dao.ShEquipmentUserDao.";
	
	//返回本DAO命名空间,并添加statement
	public String getNameSpace(String statement) {
		return NAMESPACE + statement;
	}
		
	/**
	 * 得到count数据
	 * @param deviceSupplier
	 * @return
	 */
	@Override
	public Integer queryShEquipmentUserCount(ShEquipmentUser equipmentUser) {
		return this.select(getNameSpace("selectEntryListCount"), equipmentUser);
	}

	
	/**
	 * 得到信息list
	 * @param deviceSupplier
	 * @return
	 */
	@Override
	public   List<ShEquipmentUser> queryShEquipmentUserList(ShEquipmentUser equipmentUser){
		/*Map<String, Object> map = new HashMap<String, Object>();
		map.put("orderField", "id");
        map.put("orderFieldType", "ASC");*/
		return this.selectList(getNameSpace("queryShDeviceCommPage"), equipmentUser);//selectEntryList  
	}
	
	 /**
		 * 得到用户的相关终端设备
		 * @param userDeviceBean
		 * @return
		 */
	@Override
	public   List<UserDeviceBean> queryUserDeviceListDao(java.util.HashMap params){
			return this.selectList(getNameSpace("queryUserDeviceinfo"), params);
	}
		
}